﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZH.Infrastructure.Attr;
using ZH.Infrastructure.Dto.Response;
using ZH.Infrastructure.IOC;
using ZH.Service.Interface;

namespace ZH.Service.Instance
{
    [Inject_]
    public class Room_Service : Base_Service, I_Room_Service
    {
        private readonly Room_IOC _room_IOC;

        public Room_Service(Room_IOC room_IOC)
        {
            _room_IOC = room_IOC;
        }

        public async Task<Api_Response_Dto> Get_Cashier_Rooms()
        {
            var data = await _room_IOC._room_EFCore.QueryAll().ToListAsync();

            var total = data.Count();

            return Result(1, "ok", new
            {
                total,
                data
            });

        }
    }
}
